/**
 * @param {character[][]} box
 * @return {character[][]}
 */
// '#'石头  '*'障碍   '.'空位置
 var rotateTheBox = function(box) {
    const m = box.length, n = box[0].length
    for(let i = 0; i<m; i++){
        for(let j = 0, count = 0; j<n; j++){
            if(box[i][j] === '#'){
                box[i][j] = '.'
                count++
            }
            if(box[i][j] === '*'){
                while(count--) box[i][count] = '#'
            }
        }
    }
    const ret = new Array(n).fill(0).map(() => new Array(m))
    for(let i = 0; i<n; i++){
        for(let j = 0; j<m; j++){
            ret[i][j] = box[j][i]
        }
    }
    return ret
};